package com.myjavalab.jvm;

/**
 * VM Args��-Xss128k
 * @author zzm
 */

public class JavaVMStackSOF {
       private int stackLength = 1;
//       private int stackLength1 = 1;
//       private int stackLength2 = 1;
//       private int stackLength3 = 1;
//       private int stackLength4 = 1;
//       private int stackLength5 = 1;
//       private int stackLength6 = 1;
       public void stackLeak() {
              stackLength++;
//              stackLength1++;
//              stackLength2++;
//              stackLength3++;
//              stackLength4++;
//              stackLength5++;
//              stackLength6++;
              stackLeak();
       }
       public static void main(String[] args) throws Throwable {
              JavaVMStackSOF oom = new JavaVMStackSOF();
              try {
                     oom.stackLeak();
              } catch (Throwable e) {
                     System.out.println("stack length:" + oom.stackLength);
                     throw e;
              }
       }
}